<template>
  <div>
    <!-- <img src="../assets/img/头像.jpg" alt /> -->
    <van-cell
      v-for="(item,index) in newsList"
      :key="index"
      :title="item.title"
      @click="$router.push('/articles/'+item.art_id)"
    >
      <template #label>
        <!-- 如果是多张图片 -->
        <div v-if="item.cover.images.length>1">
          <img
            v-for="(item2,index) in item.cover.images"
            :key="index"
            :src="item2"
            style="width:80px"
          />
        </div>
        <span class="custom-title">{{item.aut_name}}</span>
        <van-tag type="danger">{{item.like_count}}</van-tag>
        <span type="danger">{{item.pubdate | format}}</span>
      </template>
      <!-- 如果是一张图片 -->
      <div v-if="item.cover.images.length==1">
        <img :src="item.cover.images" style="width:80px" />
      </div>
    </van-cell>
  </div>
</template>
           
<script>
export default {
  props: ["newsList"],
  data() {
    return {};
  }
};
</script>
<style scoped lang="less">
.van-cell:nth-child(1) {
  margin-top: 180px;
}
</style>